// 市场数据类型定义

// 基础市场数据接口
export interface MarketData {
  symbol: string
  name: string
  price: number
  change: number
  changePercent: number
  volume: number
  timestamp: number
  daysToExpiry: number
  impliedVolatility: number
  openInterest: number
}

// 波动率数据接口
export interface VolatilityData {
  strike: number
  impliedVol: number
  openInterest: number
  date: string
}

// 图表数据接口
export interface ChartData {
  name: string
  data: VolatilityData[]
  type: 'line' | 'bar'
  color: string
}

// 板块分类
export type SectorType = 'all' | 'stock-index' | 'metal' | 'chemical' | 'agricultural' | 'oil' | 'ferrous'

// 交易所分类
export type ExchangeType = 'all' | 'cffex' | 'sse' | 'szse' | 'shfe' | 'dce' | 'zce' | 'ine' | 'gfex'

// 筛选条件接口
export interface FilterOptions {
  sector: SectorType
  exchange: ExchangeType
}

// 合约信息接口
export interface ContractInfo {
  code: string
  isMain: boolean
  expiryDate: string
}

// 市场工具接口
export interface MarketInstrument {
  id: string
  symbol: string
  name: string
  sector: SectorType
  exchange: ExchangeType
  currentPrice: number
  change: number
  changePercent: number
  impliedVol: number
  volChange: number
  daysToExpiry: number
  contracts: string[]
  selectedContract: string
  volatilityData: VolatilityData[]
  openInterestData: VolatilityData[]
}

// API响应接口
export interface ApiResponse<T> {
  data: T
  success: boolean
  message?: string
  timestamp: number
}

// 页面元数据接口
export interface PageMeta {
  title: string
  description: string
  keywords?: string[]
}

// 主题类型
export type ThemeType = 'light' | 'dark'

// 图表配置接口
export interface ChartConfig {
  type: 'line' | 'candlestick' | 'bar'
  data: any[]
  options?: any
  height?: string | number
  width?: string | number
}
